<!DOCTYPE html>
<html>
<head>
    <title>WebRTC 视频通话</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>WebRTC 视频通话</h1>
            <p>简单、安全的点对点视频通话</p>
        </div>

        <div class="video-chat-container">
            <div class="videos">
                <div class="video-container">
                    <div class="video-label">本地视频</div>
                    <video id="localVideo" autoplay playsinline muted></video>
                </div>
                <div class="video-container">
                    <div class="video-label">远程视频</div>
                    <video id="remoteVideo" autoplay playsinline></video>
                </div>
            </div>

            <div class="chat-container">
                <div class="chat-messages" id="chatMessages"></div>
                <div class="chat-input-area">
                    <input type="text" id="messageInput" placeholder="输入消息...">
                    <button id="sendButton">发送</button>
                </div>
            </div>
        </div>

        <div class="controls">
            <button id="startButton">开始通话</button>
            <button id="callButton" disabled>呼叫</button>
            <button id="hangupButton" disabled>挂断</button>
        </div>

        <div id="status">等待开始通话...</div>
    </div>

    <!-- 添加模态框 -->
    <div class="modal-overlay" id="roleModal">
        <div class="modal">
            <h2>选择角色</h2>
            <div class="modal-content">
                <p>请选择您在此次通话中的角色</p>
            </div>
            <div class="modal-buttons">
                <button id="initiatorBtn">发起通话</button>
                <button id="receiverBtn">接收通话</button>
            </div>
        </div>
    </div>

    <script src="main.js"></script>
</body>
</html>